-
Notifications
You must be signed in to change notification settings - Fork 10
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add f(x) = A*x, A\x #11
Conversation
@oxinabox @fredrikekre Could some of you please review this PR, so we can move forward with JuliaDiff/ForwardDiff.jl#589? Thank you! |
@mateuszbaran @mohamed82008 Could you pls take a look? |
src/DiffTests.jl
Outdated
hilbert_matrix(::Type{T}, n::Integer) where T<:Real = | ||
[convert(T, inv(i + j - 1)) for i in 1:n, j in 1:n] | ||
hilbert_matrix(x::VecOrMat) = hilbert_matrix(Float64, size(x, 1)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This function doesn't seem to be used anywhere in this PR.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This function doesn't seem to be used anywhere in this PR.
Yes, it doesn't. I was undecided which constant matrix to use, it looked like with this one the errors are higher (it is beyond my capability to track and possibly fix the source of that errors).
I can remove, if it is critical, but maybe it is better to keep it, anticipating the future extension of the test coverage.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I generally think keeping unused code in the main branch should be avoided. Everything else looks fine though in case someone with merge rights cares about my opinion 🙂 .
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree, this should be removed before we can merge
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@oxinabox done
@oxinabox @fredrikekre gentle ping to anyone with PR merge rights :) Please help me to reduce the stack of dependent PRs that I have accumulated :) |
@oxinabox Gentle ping :) I have removed the unused test function; also I have added the sparse variants of the new test functions. |
@oxinabox Thanks! Can you tag a new release? |
The PR adds
f(x) = A*x
andf(x) = A\x
functions, whereA
is a constant matrix, andx
is either a vector or a matrix.For vector arguments, the new
VECTOR_TO_VECTOR_FUNCS
list of test functions is introduced.The tested
A
matrices are: diagonal, dense, lower and upper triangular. The last three matrix types are represented by the Lehmer matrix.In particular, the
A\x
functions are useful to test the autodiff of multivariate normal distribution.This PR would be required to properly test JuliaDiff/ForwardDiff.jl#589 (so when/if merged, the version number of DiffTools.jl has to be updated).